package smartfleet.mobile.location;

import java.io.Serializable;

import smartfleet.mobile.trip.Trip;

public class Location implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8117392412894434123L;

	private int idLocation;
	private String name;
	private double longitude;
	private double latitude;
	private Trip trip;
	
	public Location(){
	}
	
	public Location(String id,String name,String latitude,String longitude){
		this.idLocation = Integer.parseInt(id);
		this.name = name;
		this.latitude = Double.parseDouble(latitude);
		this.longitude = Double.parseDouble(longitude);
	}
	
	public Location(String name,String latitude,String longitude){
		this.name = name;
		this.latitude = Double.parseDouble(latitude);
		this.longitude = Double.parseDouble(longitude);
	}
	
	/**
	 * @return the idLocation
	 */
	public int getIdLocation() {
		return idLocation;
	}
	/**
	 * @param idLocation the idLocation to set
	 */
	public void setIdLocation(int idLocation) {
		this.idLocation = idLocation;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the longitude
	 */
	public double getLongitude() {
		return longitude;
	}
	/**
	 * @param longitude the longitude to set
	 */
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	/**
	 * @return the latitude
	 */
	public double getLatitude() {
		return latitude;
	}
	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	/**
	 * @return the trip
	 */
	public Trip getTrip() {
		return trip;
	}
	/**
	 * @param trip the trip to set
	 */
	public void setTrip(Trip trip) {
		this.trip = trip;
	}
	
	public String toString(){
		return this.idLocation+","+this.name+","+this.latitude+","+this.longitude;
	}
	
}
